﻿<Serializable()> _
Public Class EproformaDetalle

#Region "           Atributos                       "
    Private _idEmpresa As Int32
    Private _idProyecto As Int32
    Private _idEtapa As Int32
    Private _idProforma As Int32
    Private _idProformaDetalle As Int32
    Private _idEdificio As Int32
    Private _descEdificio As String
    Private _idModelo As Int32
    Private _descModelo As String
    Private _idUndInmob As Int32
    Private _descUndInmob As String
    Private _idTpoInmueble As Int32
    Private _descTpoInmueble As String

    Private _monto As Decimal
    Private _descuento As Decimal
    Private _total As Decimal

    Private _estado As String
    Private _descEstado As String
    Private _idUsuario As Int32


    Private _nroInmueble As String
    Private _Eproyecto As Eproyecto
    Private _descProyecto As String
    Private _descEtapa As String
    Private _nomModelo As String
    Private _dscto As Decimal
    Private _dsctoMonto As Decimal
    Private _precioBase As Decimal
    Private _montoFinal As Decimal
    '-------    REPORTE COMISION VENDEDRO    --------'


    Private _correlativo As Int64
    Private _Evendedor As Evendedor
    Private _EdificioTpoInmuebleModeloInmueble As String
    Private _EunidInmobiliarias As EunidInmobiliarias
    Private _comisionProforma As Decimal
    Private _valorVenta As Decimal
    '------------------------------------------------'
#End Region

#Region "           Propiedades                     "
    Public Property idEmpresa() As Int32
        Get
            Return _idEmpresa
        End Get
        Set(ByVal value As Int32)
            _idEmpresa = value
        End Set
    End Property
    Public Property idProyecto() As Int32
        Get
            Return _idProyecto
        End Get
        Set(ByVal value As Int32)
            _idProyecto = value
        End Set
    End Property
    Public Property idEtapa() As Int32
        Get
            Return _idEtapa
        End Get
        Set(ByVal value As Int32)
            _idEtapa = value
        End Set
    End Property
    Public Property idProforma() As Int32
        Get
            Return _idProforma
        End Get
        Set(ByVal value As Int32)
            _idProforma = value
        End Set
    End Property
    Public Property idProformaDetalle() As Int32
        Get
            Return _idProformaDetalle
        End Get
        Set(ByVal value As Int32)
            _idProformaDetalle = value
        End Set
    End Property
    Public Property idEdificio() As Int32
        Get
            Return _idEdificio
        End Get
        Set(ByVal value As Int32)
            _idEdificio = value
        End Set
    End Property
    Public Property descEdificio() As String
        Get
            Return _descEdificio
        End Get
        Set(ByVal value As String)
            _descEdificio = value
        End Set
    End Property
    Public Property idModelo() As Int32
        Get
            Return _idModelo
        End Get
        Set(ByVal value As Int32)
            _idModelo = value
        End Set
    End Property
    Public Property descModelo() As String
        Get
            Return _descModelo
        End Get
        Set(ByVal value As String)
            _descModelo = value
        End Set
    End Property
    Public Property idUndInmob() As Int32
        Get
            Return _idUndInmob
        End Get
        Set(ByVal value As Int32)
            _idUndInmob = value
        End Set
    End Property
    Public Property descUndInmob() As String
        Get
            Return _descUndInmob
        End Get
        Set(ByVal value As String)
            _descUndInmob = value
        End Set
    End Property
    Public Property idTpoInmueble() As Int32
        Get
            Return _idTpoInmueble
        End Get
        Set(ByVal value As Int32)
            _idTpoInmueble = value
        End Set
    End Property
    Public Property descTpoInmueble() As String
        Get
            Return _descTpoInmueble
        End Get
        Set(ByVal value As String)
            _descTpoInmueble = value
        End Set
    End Property

    Public Property monto() As Decimal
        Get
            Return _monto
        End Get
        Set(ByVal value As Decimal)
            _monto = value
        End Set
    End Property
    Public Property descuento() As Decimal
        Get
            Return _descuento
        End Get
        Set(ByVal value As Decimal)
            _descuento = value
        End Set
    End Property
    Public Property total() As Decimal
        Get
            Return _total
        End Get
        Set(ByVal value As Decimal)
            _total = value
        End Set
    End Property

    Public Property estado() As String
        Get
            Return _estado
        End Get
        Set(ByVal value As String)
            _estado = value
        End Set
    End Property
    Public Property descEstado() As String
        Get
            Return _descEstado
        End Get
        Set(ByVal value As String)
            _descEstado = value
        End Set
    End Property
    Public Property idUsuario() As Int32
        Get
            Return _idUsuario
        End Get
        Set(ByVal value As Int32)
            _idUsuario = value
        End Set
    End Property

    Public Property nroInmueble() As String
        Get
            Return _nroInmueble
        End Get
        Set(ByVal value As String)
            _nroInmueble = value
        End Set
    End Property
    Public Property Eproyecto() As Eproyecto
        Get
            Return _Eproyecto
        End Get
        Set(ByVal value As Eproyecto)
            _Eproyecto = value
        End Set
    End Property
    Public Property descProyecto() As String
        Get
            Return _descProyecto
        End Get
        Set(ByVal value As String)
            _descProyecto = value
        End Set
    End Property
    Public Property descEtapa() As String
        Get
            Return _descEtapa
        End Get
        Set(ByVal value As String)
            _descEtapa = value
        End Set
    End Property
    Public Property nomModelo() As String
        Get
            Return _nomModelo
        End Get
        Set(ByVal value As String)
            _nomModelo = value
        End Set
    End Property
    Public Property dscto() As Decimal
        Get
            Return _dscto
        End Get
        Set(ByVal value As Decimal)
            _dscto = value
        End Set
    End Property
    Public Property dsctoMonto() As Decimal
        Get
            Return _dsctoMonto
        End Get
        Set(ByVal value As Decimal)
            _dsctoMonto = value
        End Set
    End Property
    Public Property precioBase() As Decimal
        Get
            Return _precioBase
        End Get
        Set(ByVal value As Decimal)
            _precioBase = value
        End Set
    End Property
    Public Property montoFinal() As String
        Get
            Return _montoFinal
        End Get
        Set(ByVal value As String)
            _montoFinal = value
        End Set
    End Property
    '-------    REPORTE COMISION VENDEDRO    --------' 
    Public Property correlativo() As Int64
        Get
            Return _correlativo
        End Get
        Set(ByVal value As Int64)
            _correlativo = value
        End Set
    End Property
    Public Property Evendedor() As Evendedor
        Get
            Return _Evendedor
        End Get
        Set(ByVal value As Evendedor)
            _Evendedor = value
        End Set
    End Property
    Public Property EdificioTpoInmuebleModeloInmueble() As String
        Get
            Return _EdificioTpoInmuebleModeloInmueble
        End Get
        Set(ByVal value As String)
            _EdificioTpoInmuebleModeloInmueble = value
        End Set
    End Property
    Public Property EunidInmobiliarias() As EunidInmobiliarias
        Get
            Return _EunidInmobiliarias
        End Get
        Set(ByVal value As EunidInmobiliarias)
            _EunidInmobiliarias = value
        End Set
    End Property
    Public Property comisionProforma() As Decimal
        Get
            Return _comisionProforma
        End Get
        Set(ByVal value As Decimal)
            _comisionProforma = value
        End Set
    End Property
    Public Property valorVenta() As Decimal
        Get
            Return _valorVenta
        End Get
        Set(ByVal value As Decimal)
            _valorVenta = value
        End Set
    End Property
    '------------------------------------------------'
#End Region

#Region "           Propiedades Avanzadas           "
    Public ReadOnly Property idEdificioModeloInmueble() As String
        Get
            Return idEdificio & "," & idModelo & "," & idUndInmob
        End Get
    End Property
    Public ReadOnly Property idProyectoEdimznUndInmob() As String
        Get
            Return "EDIFICIO: " & descEdificio & "- MODELO: " & descModelo & " - " & descTpoInmueble.ToUpper & ": " & descUndInmob
        End Get
    End Property

    '-------    REPORTE COMISION VENDEDRO    --------'    
    Public ReadOnly Property NombresCompletos() As String
        Get
            Return Evendedor.nombre & " " & Evendedor.apePaterno & " " & Evendedor.apeMaterno
        End Get
    End Property
    '------------------------------------------------'
#End Region

#Region "           Contructores                    "
    Public Sub New()

    End Sub
    Public Sub New(ByVal idProforma As Int32, ByVal idProformaDetalle As String)
        Me.idProforma = idProforma
        Me.idProformaDetalle = idProformaDetalle
    End Sub

    '-------    CONSTRUCTOR  PROFORMA / SELECCIONAR INMUEBLES   --------'
    Public Sub New(ByVal idProyecto As Int32, ByVal idEtapa As Int32, ByVal idEdificio As Int32, ByVal descEdificio As String, _
                   ByVal idModelo As Int32, ByVal descModelo As String, ByVal idUndInmob As Int32, ByVal descUndInmob As String, _
                   ByVal idTpoInmueble As Int32, ByVal descTpoInmueble As String, ByVal nroInmueble As String, ByVal monto As Decimal, _
                   ByVal descuento As Decimal, ByVal dsctoMonto As Decimal, ByVal total As Decimal)
        Me.idProyecto = idProyecto
        Me.idEtapa = idEtapa
        Me.idEdificio = idEdificio
        Me.descEdificio = descEdificio
        Me.idModelo = idModelo
        Me.descModelo = descModelo
        Me.idUndInmob = idUndInmob
        Me.descUndInmob = descUndInmob
        Me.idTpoInmueble = idTpoInmueble
        Me.descTpoInmueble = descTpoInmueble
        Me.nroInmueble = nroInmueble
        Me.monto = monto
        Me.descuento = descuento
        Me.dsctoMonto = dsctoMonto
        Me.total = total
    End Sub
    Public Sub New(ByVal idProyecto As Int32, ByVal idEtapa As Int32, ByVal idProforma As Int32, ByVal idProformaDetalle As Int32, _
                   ByVal idEdificio As Int32, ByVal descEdificio As String, ByVal idModelo As Int32, ByVal descModelo As String, _
                   ByVal idUndInmob As Int32, ByVal descUndInmob As String, ByVal idTpoInmueble As Int32, ByVal descTpoInmueble As String, _
                   ByVal monto As Decimal, ByVal descuento As Decimal, ByVal dsctoMonto As Decimal, ByVal total As Decimal)
        Me.idProyecto = idProyecto
        Me.idEtapa = idEtapa
        Me.idProforma = idProforma
        Me.idProformaDetalle = idProformaDetalle
        Me.idEdificio = idEdificio
        Me.descEdificio = descEdificio
        Me.idModelo = idModelo
        Me.descModelo = descModelo
        Me.idUndInmob = idUndInmob
        Me.descUndInmob = descUndInmob
        Me.idTpoInmueble = idTpoInmueble
        Me.descTpoInmueble = descTpoInmueble
        Me.monto = monto
        Me.descuento = descuento
        Me.dsctoMonto = dsctoMonto
        Me.total = total
        Me.Evendedor = New Evendedor(0, "", "", "")
        'Me.estado = estado
        'Me.descEstado = IIf(estado = 1, "HABILITADO", "DESHABILITADO")
    End Sub


    '-------    REPORTE COMISION VENDEDRO    --------'    
    Public Sub New(ByVal correlativo As Int64, ByVal idProyecto As Int32, ByVal idEtapa As Int32, ByVal idProforma As Int32, _
                   ByVal idProformaDetalle As Int32, ByVal idVendedor As Int32, ByVal nombre As String, ByVal apePaterno As String, _
                   ByVal apeMaterno As String, ByVal idTpoInmueble As Int32, ByVal descTpoInmueble As String, ByVal idEdificio As Int32, _
                   ByVal descEdificio As String, ByVal idModelo As Int32, ByVal descModelo As String, ByVal nroInmueble As String, _
                   ByVal valorVenta As Decimal, ByVal comisionProforma As Decimal)
        Me.correlativo = correlativo
        Me.idProyecto = idProyecto
        Me.idEtapa = idEtapa
        Me.idProforma = idProforma
        Me.idProformaDetalle = idProformaDetalle

        Me.Evendedor = New Evendedor(idVendedor, nombre, apePaterno, apeMaterno)

        Me.idTpoInmueble = idTpoInmueble
        Me.descTpoInmueble = descTpoInmueble
        Me.idEdificio = idEdificio
        Me.descEdificio = descEdificio
        Me.idModelo = idModelo
        Me.descModelo = descModelo
        Me.EunidInmobiliarias = New EunidInmobiliarias(nroInmueble, valorVenta)
        Me.valorVenta = valorVenta
        Me.comisionProforma = Math.Round(comisionProforma, 2)
    End Sub

    '-------    MENU REPORTE - CONSULTA PROFORMA DETALLE   ------------'
    Public Sub New(ByVal idProyecto As Int32, ByVal descProyecto As String, ByVal idEtapa As Int32, ByVal descEtapa As String, _
                   ByVal idProforma As Int32, ByVal idProformaDetalle As Int32, ByVal nomEdiMzn As String, ByVal nomModelo As String, _
                   ByVal descTpoInmueble As String, ByVal nroInmueble As String, ByVal monto As Decimal, ByVal dscto As Decimal, _
                   ByVal montoFinal As Decimal)

        Me.idProyecto = idProyecto
        Me.descProyecto = descProyecto
        Me.Eproyecto = New Eproyecto(idProyecto, descProyecto)
        Me.idEtapa = idEtapa
        Me.descEtapa = descEtapa
        Me.idProforma = idProforma
        Me.idProformaDetalle = idProformaDetalle
        Me.descEdificio = nomEdiMzn
        Me.nomModelo = nomModelo
        Me.descTpoInmueble = descTpoInmueble
        Me.nroInmueble = nroInmueble
        Me.monto = monto
        Me.dscto = dscto
        Me.montoFinal = montoFinal
    End Sub

    '-------    MENU REPORTE - CONSULTA PROFORMA DETALLE VERSUS  ------------'
    Public Sub New(ByVal idEmpresa As Int32, ByVal idProyecto As Int32, ByVal descProyecto As String, ByVal idEtapa As Int32, ByVal descEtapa As String, _
                   ByVal idProforma As Int32, ByVal idProformaDetalle As Int32, ByVal nomEdiMzn As String, ByVal nomModelo As String, _
                   ByVal descTpoInmueble As String, ByVal nroInmueble As String, ByVal monto As Decimal, ByVal dscto As Decimal, _
                   ByVal montoFinal As Decimal)
        Me.idEmpresa = idEmpresa
        Me.idProyecto = idProyecto
        Me.descProyecto = descProyecto
        Me.Eproyecto = New Eproyecto(idProyecto, descProyecto)
        Me.idEtapa = idEtapa
        Me.descEtapa = descEtapa
        Me.idProforma = idProforma
        Me.idProformaDetalle = idProformaDetalle
        Me.descEdificio = nomEdiMzn
        Me.nomModelo = nomModelo
        Me.descTpoInmueble = descTpoInmueble
        Me.nroInmueble = nroInmueble
        Me.monto = monto
        Me.dscto = dscto
        Me.montoFinal = montoFinal
    End Sub
    '---------------------------------------'

#End Region

End Class
